<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/plugins/vue/dist/vue.min.js"></script>
    <script src="js/plugins/axios/dist/axios.min.js"></script>
    <script src="js/commons.js"></script>
</head>
<body>
<h1 id="app">接收回调信息</h1>
</body>
<script>
    new Vue({
        el:"#app",
        data:{

        },
        methods:{

        },
        mounted(){
            let data = getUrlData();
            console.debug(data)
            this.$http.post("/wechat/login",data).then(res=>{
                if (res.data.success){
                    // 将token放在浏览器中
                    localStorage.setItem("token",res.data.resultObj.token);
                    localStorage.setItem("loginInfo",JSON.stringify(res.data.resultObj.loginInfo));
                    location.href="/index.html";
                } else {
                    // 失败跳转到绑定页面
                    location.href = res.data.message;

                }
            })
        }

    })

</script>
</html>